From 2444bd478058744b4758cd6903d4ef71c3793abc Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 23 Jan 2008 18:05:12 +0000 Subject: [PATCH] ioemu: Use asprintf instead of PATH_MAX, which POSIX says to be facultative. Signed-off-by: Samuel Thibault --- tools/ioemu/target-i386-dm/helper2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ioemu/target-i386-dm/helper2.c b/tools/ioemu/target-i386-dm/helper2.c index 2d347ccfbe..d3668ac64c 100644 --- a/tools/ioemu/target-i386-dm/helper2.c +++ b/tools/ioemu/target-i386-dm/helper2.c @@ -635,7 +635,7 @@ int main_loop(void) extern int suspend_requested; CPUState *env = cpu_single_env; int evtchn_fd = xce_handle == -1 ? -1 : xc_evtchn_fd(xce_handle); - char qemu_file[PATH_MAX]; + char *qemu_file; fd_set fds; int ret = 0; @@ -665,9 +665,9 @@ int main_loop(void) main_loop_wait(1); /* For the select() on events */ /* Save the device state */ - snprintf(qemu_file, sizeof(qemu_file), - "/var/lib/xen/qemu-save.%d", domid); + asprintf(&qemu_file, "/var/lib/xen/qemu-save.%d", domid); do_savevm(qemu_file); + free(qemu_file); xenstore_record_dm_state("paused"); -- 2.30.2